/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package spiele.RPS.factory;

import spiele.RPS.Rps;
import spiele.RPS.RpsChart;
import spiele.RPS.base.RpsAgainst;
import spiele.RPS.base.RpsMake;

/**
 * abstract factory pattern
 * @author martin
 */
public final class RpsFactory<E,M> implements RpsChart<E,M>{
  private final M _tie;
  
  public RpsFactory(final M tie){
    _tie=tie;
  }

  @Override
  public Rps<E, M> make(E attacker, E defender, M modif) {
    return new RpsMake(attacker,defender,modif);
  }

  @Override
  public Rps<E, M> agaisnt(E attacker, E defender) {
    return new RpsAgainst(attacker, defender);
  }

  @Override
  public M tie() {
    return _tie;
  }
  
}
